/*
 * @lc app=leetcode.cn id=283 lang=javascript
 *
 * [283] 移动零
 */

// @lc code=start
/**
 * @param {number[]} nums
 * @return {void} Do not return anything, modify nums in-place instead.
 */
var moveZeroes = function(nums) {
    let point = 0
    for (let index = 0; index < nums.length; index++) {
        const element = nums[index - point];
        if (element === 0) {
            nums.push(...nums.splice(index - point, 1))
            point++
        }
    }
    return nums
};
// @lc code=end

